Black body

Intro

In physics, a black body is a theoretical object that absorps áll possible frequencies or energy levels of EM waves, or similarly emits all of them. No radiation passes through it and none is reflected.
When emitting, how much electromagnetic radiation they give off only depends on their temperature.
Also the distribution of how much radiation occurs at which frequency is a very typical curve. See picture or click the "Black Body" layers for several curves of some discrete temperatures on top of eachother. The space between each curve is colored how we percieve that heated object. (Yes, a blue flame is hotter than a white flame, is hotter than a red flame.) Guess which temperature our sun has, by color!

A deeper understanding and reflection

Any matter that has a temperature radiates electromagnetic energy.
Heat is nothing more than the movement of molecules relative to each other or by themselves, such as vibration, rotation and torsion.(1) This heat energy gets released as EM Waves
And not only infra-red, though that is often the biggest part of it on earthly and daily objects and it's easy to deduct a temperature from them by measuring the IR radiation. Both are reasons why we tend to relate infrared with heat.
But also the visible and ultraviolet light we get, for example from the sun, but really from anything with a temperature, is mostly heat radiation.

(1)See more on this in the menu "Interaction with matter".

Also the opposite is true. When radiating EM waves to an object it will absorp it as heat.

Now, most matter exist of very specific molecules which have a myriad of ways to vibrate, but still only a certain limited number of ways. So it doesn't have all the possible energy levels of movement. That's why not always all frequencies will be absorped from external heat, or vice versa emited from its own heat.

Wikipedia link: https://en.wikipedia.org/wiki/Molecular_vibration

Red, white, blue? Temperature colors.

Black bodies below ±700K produce very little radiation at visible wavelengths and appear black. (We could see them via infrared camera's though.) Black bodies above this temperature however, start to produce radiation at visible wavelengths. The curve's peak starts to cross all the colors of the rainbow as the temperature increases, from red, via green ending up at blue . But we don't see these specific colors as a result. What we see, is the addition of all the colors the curve possesses at a certain temperature. You can't see green for example nor violet. The resulting colors go from red to orange to orangy white to white and than going to blue, with blue being the hottest.
Opposite to daily coloring labels (e.g. bath tub) blue is actually hottest and red coldest. That's probably because of fire and water, being hot and cold. In history our fires never reached a temperature hotter than red. Today we can see the white and blue clearly in very hot torches. Though, if we look carefully in wood fire, we can also see blue and some white, though it's mainly red/orange!
This range of colors is what is called "Temperature colors" or "Color Temperatures". They are more or less similar as the different colors seen at the horizon on a sunrise or sunset.

Interesting facts

This page is part of an interactive physics tool, the EM Spectrum Visualizer. You will be directed to this page inside of it in 5 seconds.